package com.bwie.common.config;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.Charset;

/**
 * @author: 作者
 * @create: 2025-02-28 15:19
 * @Description: TODO
 */
@Configuration
public class BloomFilterConfig {

    @Bean
    public BloomFilter<String>  bloomFilter(){
        Charset charset=Charset.forName("utf-8");
        BloomFilter bloomFilter=BloomFilter.create(Funnels.stringFunnel(charset),1000000,0.01);
        return bloomFilter;
    }

}
